<<<<<<< HEAD
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Area extends CI_Controller {
	
	function __construct(){
		parent::__construct();
	}
	
	public function get_option(){
		$pid = $this->input->post('pid');
		$selected = $this->input->post('selected');
		$str = "<option value=''>请选择</option>";
		$this->load->model('Area_model', 'area');
		$list = $this->area->get_by_pid($pid);
		foreach($list as $key => $val){
			if($selected == $key){
				$str .= "<option value='".$key."' selected='selected'>".$val."</option>";
			}else{
				$str .= "<option value='".$key."'>".$val."</option>";
			}
		}
		echo $str;
	}
	
	
=======
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Area extends CI_Controller {
    
	function __construct(){
		parent::__construct();
	}
	
	public function get_option(){
		$pid = $this->input->post('pid');
		$selected = $this->input->post('selected');
		$str = "<option value=''>请选择</option>";
		$this->load->model('Area_model', 'area');
		$list = $this->area->get_by_pid($pid);
		foreach($list as $key => $val){
			if($selected == $key){
				$str .= "<option value='".$key."' selected='selected'>".$val."</option>";
			}else{
				$str .= "<option value='".$key."'>".$val."</option>";
			}
		}
		echo $str;
	}
	
	
>>>>>>> d47623b610d79a4eeb489500830c00d70933f414
}